// 线段树+扫描线+离散化，按横坐标排序扫描纵线，len表示纵线覆盖的总长度
#include<cstdio>
#include<cstring>
#include<stack>
#include<queue>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
const double EPS=1e-6;
const int maxn=110;
struct Line
{
	double x,y1,y2;
	int flag;
}line[maxn*2];
double y[maxn*2];
int n;
struct node
{
	int left,right;
	double lf,ri,len;
	int cov;
}tree[maxn*8];

bool cmp(Line a,Line b)
{
	return a.x<b.x;
}

void build(int L,int R,int u)
{
	tree[u].left=L;
	tree[u].right=R;
	tree[u].lf=y[L];
	tree[u].ri=y[R];
	tree[u].cov=tree[u].len=0;
	if(L+1==R)return;
	int mid=(L+R)/2;
	build(L,mid,u*2);
	build(mid,R,u*2+1);
}

void update(int u,Line e)
{
	if(e.y1<=tree[u].lf&&e.y2>=tree[u].ri)
	{
		if(e.flag==1)
		{
			tree[u].len=tree[u].ri-tree[u].lf;
			tree[u].cov++;
		}
		else
		{
			tree[u].cov--;
			if(tree[u].cov==0)
			{
				if(tree[u].left+1==tree[u].right)
					tree[u].len=0;
				else
					tree[u].len=tree[u*2].len+tree[u*2+1].len;
			}
		}
		return;
	}
	if(e.y1<tree[u*2].ri)
		update(u*2,e);
	if(e.y2>tree[u*2+1].lf)
		update(u*2+1,e);
	if(tree[u].cov==0)
		tree[u].len=tree[u*2].len+tree[u*2+1].len;
}

int main()
{
	int count=0,t;
	while(scanf("%d",&n),n!=0)
	{
		count++;
		for (int i = t = 1; i <= n; i++, t++ )
		{
			double x1,x2,y1,y2;
			scanf("%lf%lf%lf%lf",&x1, &y1, &x2, &y2 );
			line[t].x = x1;
			line[t].y1 = y1;
			line[t].y2 = y2;
			line[t].flag = 1;
			y[t] = y1;
			t++;
			line[t].x = x2;
			line[t].y1 = y1;
			line[t].y2 = y2;
			line[t].flag = -1;
			y[t] = y2;
		}
		t--;
		sort(line+1, line+t+1,cmp);
		sort(y+1,y+t+1);
		build(1,t,1);
		update(1,line[1]);
		double ans=0;
		for(int i=2;i<=t;i++)
		{
			ans+=(line[i].x-line[i-1].x)*tree[1].len;
			update(1,line[i]);
		}
		printf ( "Test case #%d\n", count );
		printf ( "Total explored area: %.2lf\n\n", ans );
	}
	return 0;
}




	

